function [x,y] = QR(A)
%QR QR分解
%   此处显示详细说明
[m,n] = size(A);
d = zeros(n,1);
for j = 1:n
    if j < m
        [v,Beta] = Householder(A(j:m,j));
        I = eye(m-j+1);
        A(j:m,j:n) = (I - Beta*(v*v'))*A(j:m,j:n);
        d(j) = Beta;
        A(j+1:m,j) = v(2:m-j+1);
    end
end
x = A;
y = d;
end

